package structural.flyweight;

import java.util.ArrayList;
import java.util.List;

public class PointService {
    private final PointIconFactory iconFactory;

    public PointService(PointIconFactory iconFactory) {
        this.iconFactory = iconFactory;
    }

    public List<Point> getPoints() {
        List<Point> points = new ArrayList<>();
        points.add(new Point(10, 20, iconFactory.getIcon(PointType.PARK)));
        points.add(new Point(30, 40, iconFactory.getIcon(PointType.HOSPITAL)));
        return points;
    }
}
